]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ScreenShield: wait for stage mapping before taking a grab
authorGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 4 Sep 2012 18:47:20 +0000 (20:47 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 13 Sep 2012 22:54:50 +0000 (00:54 +0200)
In gdm, we would attempt to become modal during the synchronous initialization,
and this would fail, as X prevents grabs on unmapped windows. Instead,
wait for the stage to be visible before becoming modal.

https://bugzilla.gnome.org/show_bug.cgi?id=683357

js/ui/screenShield.js

index 8f93e4a276801c3374889f5652d859e18a574328..21e05673ebbabbf963db5f9bf1d724eec58726cc 100644 (file)
@@ -558,10 +558,16 @@ const ScreenShield = new Lang.Class({
     },
 
     showDialog: function() {
-        if (!this._isModal) {
-            Main.pushModal(this.actor);
-            this._isModal = true;
-        }
+        // Ensure that the stage window is mapped, before taking a grab
+        // otherwise X errors out
+        Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
+            if (!this._isModal) {
+                Main.pushModal(this.actor);
+                this._isModal = true;
+            }
+
+            return false;
+        }));
 
         this.actor.show();
         this._isGreeter = Main.sessionMode.isGreeter;